import requests,unittest
from two.Day2.Tools import Tools
from ddt import ddt,data,unpack

#初始数据
path=r"C:\Users\HP\Desktop\A3mall_login.xlsx"
sheetname='Sheet1'
#断言
dy=Tools(path,sheetname)
print(dy.getdate())

@ddt
class A3mall(unittest.TestCase):

    #登录 login
    @unpack
    @data(*dy.getdate())
    def test_01_login(self,username,password,case):
        url='http://10.59.9.14:7003/api/public/login'
        json={"username":username,"password":password}
        login=requests.post(url=url,json=json)
        #预期结果
        print('*****'+case+'*****')
        print(login.json())




#执行
if __name__ == '__main__':
    unittest.main()